

//console.log('http'.match(/(?:([^#]+))?/));


let result = 'http://'.match(/(?:([^:]+):\/\/)?/)
console.log(result);
